package com.snail.constants;

/**
 * @Author 蔡徐坤
 * @Date 2025/8/15 14:41
 * @Description: TODO
 */
public class OAuthRedisConstants {
    // 授权码（authorization_code）存储 key: oauth:auth_code:{code} -> value: json (AuthCodeInfo)
    public static final String OAUTH_AUTH_CODE = "oauth:auth_code:";

    // refresh token 存储 key: oauth:refresh_token:{token} -> value: json (RefreshTokenInfo)
    public static final String OAUTH_REFRESH_TOKEN = "oauth:refresh_token:";

    // 第三方登录回调临时数据（provider -> state -> data）
    public static final String OAUTH_THIRD_STATE = "oauth:third:state:";

    // 授权客户端信息（如果需要可以存 db）
    public static final String OAUTH_CLIENT_PREFIX = "oauth:client:";

    public static final long AUTH_CODE_EXPIRE_SECONDS = 300L; // 5分钟
    public static final long ACCESS_TOKEN_EXPIRE_SECONDS = 3600L; // 1小时（sa-token 本身管理）
    public static final long REFRESH_TOKEN_EXPIRE_SECONDS = 60 * 60 * 24 * 30; // 30天
}
